package cn.com.hatech.cdkey.config.upload;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Copyright (C), 2019, 北京同创永益科技发展有限公司
 * @FileName: UploadConfig
 * @author: xuruikai
 * @Date: 2019-08-08 14:30
 * @Description: 文件上传相关配置
 */
@Component
@ConfigurationProperties(prefix = "file-service")
@Data
public class UploadConfig {
    /**
     * 文件上传base路径
     */
    private static String profile;

    public void setProfile(String profile) {
        UploadConfig.profile = profile;
    }

    /**
     * 获取文件上传路径
     *
     * @param
     * @return java.lang.String
     * @method getUploadPath
     * @author xuruikai
     * @version 1.0
     * @Exception
     * @date 14:30 2019/8/8
     */
    public static String getUploadPath() {
        return profile + "upload/";
    }
}
